﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using SuperQuiz.Logic;

namespace SuperQuiz.Model
{
    public class Quiz : BindableBase
    {
        private bool _ShowCorrectAnswerOnFinish;
        public bool ShowCorrectAnswerOnFinish
        {
            get { return this._ShowCorrectAnswerOnFinish; }
            set { this.SetProperty(ref this._ShowCorrectAnswerOnFinish, value); }
        }

        private bool _ShowScoreWhilePlays = true;
        public bool ShowScoreWhilePlays
        {
            get { return this._ShowScoreWhilePlays; }
            set { this.SetProperty(ref this._ShowScoreWhilePlays, value); }
        }

        private bool _ShowFinishOnlyWhenReachedLastQuestion;
        public bool ShowFinishOnlyWhenReachedLastQuestion
        {
            get { return this._ShowFinishOnlyWhenReachedLastQuestion; }
            set { this.SetProperty(ref this._ShowFinishOnlyWhenReachedLastQuestion, value); }
        }

        private bool _AllowPreviousNavigation;
        public bool AllowPreviousNavigation
        {
            get { return this._AllowPreviousNavigation; }
            set { this.SetProperty(ref this._AllowPreviousNavigation, value); }
        }

        private bool _AllowShareQuestions;
        public bool AllowShareQuestions
        {
            get { return this._AllowShareQuestions; }
            set { this.SetProperty(ref this._AllowShareQuestions, value); }
        }

        private bool _LockQuestionWhenEvaluated;
        public bool LockQuestionWhenEvaluated
        {
            get { return this._LockQuestionWhenEvaluated; }
            set { this.SetProperty(ref this._LockQuestionWhenEvaluated, value); }
        }

        private bool _LockQuestionWhenNavigateToNext;
        public bool LockQuestionWhenNavigateToNext
        {
            get { return this._LockQuestionWhenNavigateToNext; }
            set { this.SetProperty(ref this._LockQuestionWhenNavigateToNext, value); }
        }

        private bool _LockQuestionWhenNavigateToPrevious;
        public bool LockQuestionWhenNavigateToPrevious
        {
            get { return this._LockQuestionWhenNavigateToPrevious; }
            set { this.SetProperty(ref this._LockQuestionWhenNavigateToPrevious, value); }
        }

        private bool _ShowFinishButton = true;
        public bool ShowFinishButton
        {
            get { return this._ShowFinishButton; }
            set { this.SetProperty(ref this._ShowFinishButton, value); }
        }

        private bool _EvaluateAnswersOnFinish;
        public bool EvaluateAnswersOnFinish
        {
            get { return this._EvaluateAnswersOnFinish; }
            set { this.SetProperty(ref this._EvaluateAnswersOnFinish, value); }
        }

        private bool _EvaluateAnswerOnNext;
        public bool EvaluateAnswerOnNext
        {
            get { return this._EvaluateAnswerOnNext; }
            set { this.SetProperty(ref this._EvaluateAnswerOnNext, value); }
        }

        private bool _ShowHomeButtonOnFinish;
        public bool ShowHomeButtonOnFinish
        {
            get { return this._ShowHomeButtonOnFinish; }
            set { this.SetProperty(ref this._ShowHomeButtonOnFinish, value); }
        }

        private string _UniqueId;
        public string UniqueId
        {
            get { return this._UniqueId; }
            set { this.SetProperty(ref this._UniqueId, value); }
        }

        private string _Name;
        public string Name
        {
            get { return this._Name; }
            set { this.SetProperty(ref this._Name, value); }
        }

        private string _Description;
        public string Description
        {
            get { return this._Description; }
            set { this.SetProperty(ref this._Description, value); }
        }

        private string _ImageUri;
        public string ImageUri
        {
            get { return this._ImageUri; }
            set { this.SetProperty(ref this._ImageUri, value); }
        }

        private ObservableCollection<QuizQuestion> _Questions;
        public ObservableCollection<QuizQuestion> Questions
        {
            get { return this._Questions; }
            set { this.SetProperty(ref this._Questions, value); }
        }

        [IgnoreDataMember]
        public QuizCategory Category
        {
            get { return QuizApplication.Instance.GetCategory(CategoryUniqueId); }
            set { CategoryUniqueId = value.UniqueId; }
        }

        private string _CategoryUniqueId;
        public string CategoryUniqueId
        {
            get { return this._CategoryUniqueId; }
            set { this.SetProperty(ref this._CategoryUniqueId, value); }
        }

        private string _ResultsControlFullName;
        public string ResultsControlFullName
        {
            get { return this._ResultsControlFullName; }
            set { this.SetProperty(ref this._ResultsControlFullName, value); }
        }
    }
}
